package com.zzk.protect.controller;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.zzk.protect.common.CommonResult;
import com.zzk.protect.pojo.Department;
import com.zzk.protect.service.DepartmentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/dept")
public class DepartmentController {
    @Autowired
    private DepartmentService departmentService;
    @GetMapping("/list")
    public CommonResult<List<Department>> list(){
        QueryWrapper<Department> qw = new QueryWrapper<>();
        List<Department> list =departmentService.list(qw);
        return CommonResult.success(list);
    }
}
